/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-11-17 16:19:36
 * @LastEditors: huangtianyang
 * @LastEditTime: 2024-04-23 11:22:59
 * @FilePath: \cxl-driving-training\src\utils\interface.ts
 */

/**
 * 
 * 当类型为file
 * value的格式为
 * value:[{index:0,tag:'',tpye:'',list:[{name:'',key:'',url:''}]}]
        {
            key: 'vehicleType',
            label: '学车类型：',
            placeholder: '请选择学车类型',
            value: [],
            type: 'file',
            width: 1,
            required: true,
            message: '请选择学车类型',
            trigger: 'change',
            valid: true,
            options: [
                { value: '1', label: '小车' },
                { value: '2', label: '摩托车' },
                { value: '3', label: '无人机' }
            ]
        } 

* 当类型为 radio-button
        {
            key: 'selectIndex',
            label: '',
            placeholder: '',
            required: false,
            message: '',
            value: '政府资质',
            index: 0, //默认是选中radioList的第0个
            type: 'radio-button',
            width: 3,
            trigger: 'blur',
            options: [],
            valid: true,
            radioList: ['政府资质', '发展历程', '所获荣誉', '驾校详情'],
            describe: [],
            content: [],
            radioHideDescribeIndex:3
        }

 */

//表单接口
export interface formDataInterface {
    key?: string
    label?: string
    value?: string | number | any[]
    placeholder?: string //输入描述
    type?: string //text | number | select | addr | image | tinymce
    width?: number //默认1 模块占的位置宽度 1|2|3|4
    required?: boolean //是否是必填项
    message?: string //不通过验证提示信息
    trigger?: string //触发验证类型 blur | change
    valid?: boolean //是否通过验证 默认通过
    options?: any[] //类型为select时的选项列表
    hint?: string //提示语
    count?: string[] | number //类型为file时，需要上传的file类型及数量
    tagVisible?: boolean //类型为image时，是否为该图片添加标签
    latLng?: Array<string | number>
    sizeRatio?: number[] //上次图片|视频的宽高比例
    imageCount?: number //图片的数量
    videoCount?: number //视频的数量
    dirType?: string //文件上传的目录
    index?: number //默认是选中radioList的第0个
    radioList?: string[] //radio-button 数组
    describe?: string[] //radio-button 对应描述
    content?: string[] //radio-button 对应内容
    radioHideDescribeIndex?: number //radio-button 对应选中隐藏描述
    maxlength?: number //文本输入的长度
    rvalidateVent?: string //触发验证类型 phone
    rvalidateErrorMsg?: string //验证不通过提示
    [propName: string]: any //动态匿名属性
}
interface title {
    title: string
}

export type PropsFormpData = formDataInterface[] | title

export interface fileListProps {
    url?: string
    name: string
    key: string
    type?: string
}

export interface fileProps {
    index: number
    tag: string
    type: string
    list: fileListProps[]
}

export interface tagProps {
    describe: string
    label: string
}
